package com.dge.app.utils;

import com.dge.app.MyApplication;
import ohos.agp.components.AttrHelper;

public class SizeUtils {

    public static int vp2px(int vp) {
        return AttrHelper.vp2px(vp, AttrHelper.getDensity(MyApplication.context));
    }
    public static int fp2px(int vp) {
        return AttrHelper.fp2px(vp, AttrHelper.getDensity(MyApplication.context));
    }

    public static int getScreenWidth() {
        return vp2px(MyApplication.context.getResourceManager().getDeviceCapability().width);
    }

    public static int getScreenHeight() {
        return vp2px(MyApplication.context.getResourceManager().getDeviceCapability().height);
    }

    public static int getScreenDensity() {
        return MyApplication.context.getResourceManager().getDeviceCapability().screenDensity;
    }
}
